<!--
/**************************************************
* @ marketinfoquery.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/05/27, Jenny Li
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>市场信息</title>
	<META http-equiv=Content-Type content="text/html; charset=UTF-8">
	<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
	<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
	<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
</head>
<%
	ResultProcess tRs = (ResultProcess)request.getAttribute("marketinfo");
	ArrayList tList = new ArrayList();
%>
<script>
	function selectCompany()
	{
		var url = "<%=response.encodeURL(root+"/A401103.do")%>";
           var returnv = window.open(url,null," edge: sunken ,center: Yes, help: No, resizable: Yes, status: No,height=580px, scrollbars=yes");

	}	
	function process(val){
		if(val == 'C'){
			marketinfoform.title.value ="";	
			marketinfoform.content.value ="";
			marketinfoform.providerName.value ="";
			marketinfoform.publishDateStr.value ="";
			marketinfoform.publishDateEnd.value ="";
			document.all.provider_id.value ="";															
		}else if(val == 'Q'){
			marketinfoform.action = "<%=response.encodeURL(root + "/A220202.do")%>";
			marketinfoform.submit();
		}	
	}	

</script>
<body BGCOLOR="#f5f5f5"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">市场信息管理</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>
<form name="marketinfoform" method="get" >

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>信息标题</TD>
					<TD left=left class="bg_row_odd">
						<input type="text" name="title" maxlength="500" value="<%=request.getParameter("title") == null? "":request.getParameter("title")%>">					
					</TD>					
					<TD class="bg_column" align=center>内容</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="content" value="<%=request.getParameter("content") == null? "":request.getParameter("content")%>">
					</TD>					
				</TR>
				
				<TR height=20>
					<TD class="bg_column" align=center>调价供应商</TD>
					<TD left=left class="bg_row_odd" colspan="3">
						<input type="text" id="provider_name" name="providerName" readonly value="<%=request.getParameter("providerName") == null? "":request.getParameter("providerName")%>">					
						<input type="button" class="kuang" value="选择供应商" onClick="selectCompany();">
						<input type="hidden" class="kuang" name="provider" id="provider_id" value="<%=request.getAttribute("provider_id") == null? "":request.getAttribute("provider_id")%>">						
					</TD>					
				</TR>
				<TR height=20>	
					<TD class="bg_column" align=center>发布日期</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					<input type="text"	name="publishDateStr" value="<%=request.getParameter("publishDateStr")==null?"":request.getParameter("publishDateStr")%>" length="20" onfocus="setday(this)" readonly> 
					到<input type="text"	name="publishDateEnd" length="20" value="<%=request.getParameter("publishDateEnd")==null?"":request.getParameter("publishDateEnd")%>" onfocus="setday(this)" readonly>
					</TD>
				</TR>
            <%
            if(tRs != null) {
                int totalRecords = 0;
                if(request.getAttribute("totalRecords")!=null){
                    totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
                }
                int defaultPageSize =10;
                if(request.getAttribute("pageSize")!=null){
                    defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
                }
            %>          
            <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
            <%} %>			
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
		<input type="button" width="58" class="kuang" height="24" value="查询" onclick="process('Q')"/>&nbsp;
		<input type="button" width="58" class="kuang" height="24" value="清空" onclick="process('C')"/>
    </p>
    <%
    	if(tRs != null){
	%>    	    
    		<center>
    	    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    			<tr>
    				<td>
                    <form name='pager' method="post">
    	            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
    	                    <tbody> 
    	                    <%
    	                    tList = tRs.getAllRecoreds();
    	                    if(tList != null && tList.size() > 0){
    	                    %>
							  <tr class="bg_column" height=20>
							    <td width="960" height="16" colspan="13" align="right">
										<!--导航条-->
							    		<page:navigator type='text' queryForm='marketinfoform'/>
							    </td>
							  </tr>	
							  <% 
	    	                    }
							  %>    	                    
    	                    <tr class="bg_column" height=20>              							
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">信息标题</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">调价供应商</div>
    							</td>						
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">发布日期</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">相关附件</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">详细信息</div>
    							</td>																																																																						
    						</tr>
				<%
				if(tList != null && tList.size() > 0){
				for(int i=0; i<tList.size(); i++){
				    GSMarketInfoQryVO tVO= (GSMarketInfoQryVO)tList.get(i);
					String tTempStr="";
					if(i%2==0){
						tTempStr="class=\"bg_row_odd\"";
					}else {
						tTempStr="class=\"bg_row_even\"";
					}
				%>
							<tr <%=tTempStr%> height=20>							
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A220203.do?createDate="+tVO.createDate) %>" target="_blank"><%=tVO.title%></a>
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tVO.providerName%>
									</div>
								</td>					
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tVO.publishDate%>
									</div>
								</td>					
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A220204.do?createDate=" + tVO.createDate) %>" ><%=tVO.fileName%></a>
<!--									<a href="<%=response.encodeURL(root + "/DownLoadFile?fileName=" + tVO.fileName) %>" ><%=tVO.fileName%></a>-->
									</div>
								</td>				
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A220203.do?createDate="+tVO.createDate) %>" target="_blank">详细</a>
									</div>
								</td>																						
							</tr>
			<%
				}
			%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="13" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm='marketinfoform'/>
						    </td>
						  </tr>					
			<%	
				}else{
					%>
					<font color="red">没有符合条件的市场信息</font>
			<%
				}
			%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>	
	<%    						
    	}
    	
    %>
    </body>
</html>